x86: deny access to the ACPI PM timer I/O port range for Dom0
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 28 Oct 2009 10:55:53 +0000 (10:55 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 28 Oct 2009 10:55:53 +0000 (10:55 +0000)
Also move the declaration of pmtmr_ioport to a suitable header file.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/acpi/boot.c
xen/arch/x86/acpi/cpu_idle.c
xen/arch/x86/domain_build.c
xen/arch/x86/time.c
xen/include/asm-x86/acpi.h

index 121d1bae4c62f41f1368f734d8b8498e526af176..e6cc2de6f2bcc660b12d9230d2943a0a6ff74674 100644 (file)
@@ -332,10 +332,6 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
 #define        acpi_parse_hpet NULL
 #endif
 
-#ifdef CONFIG_X86_PM_TIMER
-extern u32 pmtmr_ioport;
-#endif
-
 #ifdef CONFIG_ACPI_SLEEP
 #define acpi_fadt_copy_address(dst, src, len) do {                     \
        if (fadt->header.revision >= FADT2_REVISION_ID)                 \
index 61f294f7bccdd55a01570e00df983f1e2a77cf09..35c272358264843035e8c5014f4ee8fb9a852c08 100644 (file)
@@ -56,7 +56,6 @@ static void lapic_timer_nop(void) { }
 static void (*lapic_timer_off)(void);
 static void (*lapic_timer_on)(void);
 
-extern u32 pmtmr_ioport;
 extern void (*pm_idle) (void);
 extern void (*dead_idle) (void);
 extern void menu_get_trace_data(u32 *expected, u32 *pred);
index 06a285f231ecdb3c27fc32ca703f14cc0b6f8338..a740791e569f1b46b7fce0af001b12deadc1daf8 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/paging.h>
 #include <asm/p2m.h>
 #include <asm/e820.h>
+#include <asm/acpi.h>
 #include <asm/bzimage.h> /* for bzimage_parse */
 
 #include <public/version.h>
@@ -1064,6 +1065,9 @@ int __init construct_dom0(
     rc |= ioports_deny_access(dom0, 0x40, 0x43);
     /* PIT Channel 2 / PC Speaker Control. */
     rc |= ioports_deny_access(dom0, 0x61, 0x61);
+    /* ACPI PM Timer. */
+    if ( pmtmr_ioport )
+        rc |= ioports_deny_access(dom0, pmtmr_ioport, pmtmr_ioport + 3);
     /* PCI configuration space (NB. 0xcf8 has special treatment). */
     rc |= ioports_deny_access(dom0, 0xcfc, 0xcff);
     /* Command-line I/O ranges. */
index 06bf69f51db812eab668f312dbebfe5fff65aa08..982ce7ca5283db0883f0bebb78cd932170886147 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/fixmap.h>
 #include <asm/mc146818rtc.h>
 #include <asm/div64.h>
+#include <asm/acpi.h>
 #include <asm/hpet.h>
 #include <io_ports.h>
 #include <asm/setup.h> /* for early_time_init */
index b2bb9d986972ab1ab42aeeb2b11b1ba764cb6453..7666c2cfadb5b131975253c08b5b345bdccfe960 100644 (file)
@@ -153,6 +153,8 @@ struct acpi_sleep_info {
 extern u8 x86_acpiid_to_apicid[];
 #define MAX_LOCAL_APIC 256
 
+extern u32 pmtmr_ioport;
+
 int acpi_dmar_init(void);
 void acpi_mmcfg_init(void);